//
//  PXHStringComparison.m
//  Courses
//
//  Created by YiXuePxh on 15/5/15.
//  Copyright (c) 2015年 boyibang. All rights reserved.
//

#import "PXHStringComparison.h"
#import "MBProgressHUD.h"
@implementation PXHStringComparison
void ShowTextPromptDelayHide(NSString *info, CGFloat seconds, UIView *superView){
    [MBProgressHUD hideAllHUDsForView:superView animated:NO];
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:superView animated:NO];
    hud.userInteractionEnabled = NO;
    hud.detailsLabelText = info;
    hud.yOffset = -50.0;
    hud.mode = MBProgressHUDModeText;
    [hud hide:YES afterDelay:seconds];
}
//判断手机号码，1开头的十一位数字
+(BOOL)stringCheckPhoneNumberInput:(NSString* )_text{
    NSString* regex = @"(1(3|5|7|8))\\d{9}$";
    NSPredicate* emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
    return [emailTest evaluateWithObject:_text];
}
//判断密码是不是6-16位
+(BOOL)stringCheckPasswordInput:(NSString* )_text{
    NSString* regex = @"[A-Z0-9a-z_-]{6,30}";
    NSPredicate* emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
    return [emailTest evaluateWithObject:_text];
}
@end
